package com.itheima.mapper;

import com.itheima.domain.User;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;

public interface UserMapper {

    @Select("select * from user where user_email=#{email} and user_password =#{password} and user_status = '0' ")
     @Results(id = "userResult",value = {
             @Result(id = true,property = "id",column = "user_id"),
             @Result(property = "name",column = "user_name"),
             @Result(property = "password",column = "user_password"),
             @Result(property = "email",column = "user_email"),
             @Result(property = "role",column = "user_role"),
             @Result(property = "status",column = "user_status"),
     })
    User findUserByEmailAndPassword(User user);

}
